str = "abc123f3456 a %*&"
abcNum=0
digitNum=0
spaceNum=0
otherNum=0
for i in list(str):
    if i.isalpha(): abcNum+=1
    elif i.isdigit(): digitNum+=1
    elif i.isspace(): spaceNum+=1
    else: otherNum+=1
print(f"字母数量：{abcNum},数字数量：{digitNum},空格数量：{spaceNum},其他数量{otherNum}")